package com.aspose.cells.a.d.a;

import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;

public class zm extends Properties {
   private static final long serialVersionUID = 3297483251864528952L;
   protected Properties a = new Properties();

   public Enumeration propertyNames() {
      ArrayList var1 = new ArrayList();
      Enumeration var2 = super.propertyNames();

      while(var2.hasMoreElements()) {
         var1.add(var2.nextElement());
      }

      if (this.a != null) {
         var2 = this.a.propertyNames();

         while(var2.hasMoreElements()) {
            var1.add(var2.nextElement());
         }
      }

      return Collections.enumeration(var1);
   }

   public void a(Properties var1) {
      Enumeration var2 = var1.propertyNames();

      while(var2.hasMoreElements()) {
         String var3 = (String)var2.nextElement();
         this.setProperty(var3, var1.getProperty(var3));
      }

   }

   public Object setProperty(String key, String value) {
      return value == null ? super.setProperty(key, "null") : super.setProperty(key, value);
   }

   public Object a(String var1, Color var2) {
      return a(this, var1, var2);
   }

   public static Object a(Properties var0, String var1, Color var2) {
      return var2 == null ? var0.setProperty(var1, "null") : var0.setProperty(var1, var2.getRed() + ", " + var2.getGreen() + ", " + var2.getBlue() + ", " + var2.getAlpha());
   }

   public Object a(String var1, boolean var2) {
      return a(this, var1, var2);
   }

   public static Object a(Properties var0, String var1, boolean var2) {
      return var0.setProperty(var1, Boolean.toString(var2));
   }

   public String getProperty(String key) {
      String var2 = super.getProperty(key);
      return var2 != null ? var2 : this.a.getProperty(key);
   }

   public String getProperty(String key, String def) {
      String var3 = this.getProperty(key);
      return var3 != null ? var3 : def;
   }

   public Color a(String var1) {
      return this.b(var1, (Color)null);
   }

   public Color b(String var1, Color var2) {
      String var3 = this.getProperty(var1);
      if (var3 == null) {
         return var2;
      } else if (var3.equals("null")) {
         return null;
      } else {
         String[] var4 = var3.split(", ");
         return new Color(Integer.parseInt(var4[0]), Integer.parseInt(var4[1]), Integer.parseInt(var4[2]), Integer.parseInt(var4[3]));
      }
   }

   public boolean b(String var1) {
      return this.b(var1, false);
   }

   public boolean b(String var1, boolean var2) {
      return new Boolean(this.getProperty(var1, Boolean.toString(var2)));
   }
}
